function addsource() {
		var mo = $("#addsource")
		mo.modal('show');
	}
function addinteresting() {
	var mo = $("#interesting")
	mo.modal('show');
}

$(function() {
	$('.selection.dropdown').dropdown();
	$("div.checkbox").checkbox();
	var checkAll = $("#checkAll");
	var itemCheck = $(".item-check");

	checkAll.on("change", function() {
		//获取全选框选中状态
		itemCheck.prop("checked", this.checked)
	});

	itemCheck.on("change", function() {
		//判断判断选中的个数是否和所有存在个数一样
		var checkeds = $(".item-check:checked");
		//修改checkAll的checked属性
		checkAll.prop("checked", checkeds.length == itemCheck.length);
	});

	//批量删除按钮事件
	$('#delete').on(
			'click',
			function() {
				//获取所有选中
				var checkeds = $(".item-check:checked");
				if (checkeds.length && confirm("确认要删除所有选中行吗？")) {
					//获取所有选择的id
					var ids = [];
					checkeds.each(function() {
						ids.push(this.value);
					});
					///../teacher/student/delete?id=ids
					location.replace("interesting/delete?id="
							+ ids.join("&id="));
				}
			});
});